<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    'use strict'
    // 必须声明变量
    var num = 10;
    console.log(num);
    //delete num; //不能删除变量
    console.log(num);

    show()
    function show () {
      'use strict';
      var x = 0;
      console.log(1);
      console.log(this);// 严格模式, this指向 undefined
    }

    function Person (name) {
      this.name = name;
      this.say = function () {
        console.log(this);
        console.log(1);
      }
    }
    //Person('张三') 严格模式, 构造器不能直接调用, 因为没有实例化this指向不知道
    new Person("小米").say()


    setTimeout(function () {
      console.log(this);//严格和非严格 this都指向window
    }, 1000)

    function method (a, b) {
      console.log(a, b);
    }
    method(1, 2, 3)

  </script>
</body>

</html>